package com.design.factory.AbstractFactory;

//纽约的 披萨店
public class PizzaStoreNY extends PizzaStore {              //披萨店 + 纽约

    protected Pizza createPizza(String item) {
        Pizza pizza = null;
        PizzaIngredientFactory ingredientFactory = new PizzaIngredientFactoryNY(); //纽约方的 + 配料

        if (item.equals("cheese")) {
            pizza = new PizzaSonCheese(ingredientFactory);     //披萨 + 奶酪  <---  (纽约方的 + 配料)
            pizza.setName("--New York Style Pizza--Cheese");
        } else if (item.equals("veggie")) {
            pizza = new PizzaSonVeggie(ingredientFactory);
            pizza.setName("--New York Style Pizza--Veggie");
        } else if (item.equals("clam")) {
            pizza = new PizzaSonClam(ingredientFactory);
            pizza.setName("--New York Style Pizza--Clam");
        } else if (item.equals("pepperoni")) {
            pizza = new PizzaSonPepperoni(ingredientFactory);
            pizza.setName("--New York Style Pizza--Pepperoni");
        }
        return pizza;
    }
}
